# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=fluidsynth
pkgver=2.1.4
pkgrel=0
arch="all"
url="http://www.fluidsynth.org"
pkgdesc="A real-time software synthesizer based on the SoundFont 2 specifications"
license="LGPL-2.1-or-later"
depends_dev="glib-dev libsndfile-dev alsa-lib-dev pulseaudio-dev readline-dev dbus-dev"
makedepends="$depends_dev cmake doxygen graphviz"
source="https://github.com/fluidsynth/fluidsynth/archive/v$pkgver/fluidsynth-v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLIB_INSTALL_DIR=lib \
		-DFLUID_DAEMON_ENV_FILE=/etc/conf.d/fluidsynth
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="22e8d2f8b144f96a334aff1f7d183b91e6c5418482bd61553028ff571836b0ca13fff89e7e3cc1c2d08e106a430331d179e607d78b00e218baec433b6d140190  fluidsynth-v2.1.4.tar.gz"
